<?php
/* 
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
function menu_link_to($name, $routeName, $params=array(), $options=array())
{
  if(sfContext::getInstance()->getRouting()->getCurrentRouteName() == $routeName)
  {
    if(!isset($options['active_class']))
      $options['active_class'] = 'active';

    if(isset($options['class']))
      $options['class'].=$options['active_class'].' '.$options['class'];
    else
      $options['class']=$options['active_class'];
  }
  unset($options['active_class']);
  return link_to($name, $routeName, $params, $options);
}
?>
